package com.onjob.recruit;

import java.sql.SQLException;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;

import util.dao.HibernateDaoImpl;

public class RecruitDaoImpl extends HibernateDaoImpl<Recruit, String> implements
		RecruitDao {

	public void deleteRecruitFindByCompany(final Company company) {
		this.getHibernateTemplate().execute(new HibernateCallback() {

			@Override
			public Object doInHibernate(Session session)
					throws HibernateException, SQLException {
				session.createQuery("delete from" + Recruit.class.getName()
						+ " r where r.companyId.id=" + company.getId());
				return null;
			}

		});
	}
}
